#include "fmt/core.h"
#include "network/sockaddr.hpp"

#include <arpa/inet.h>

using namespace ibox::network;
int main() {
    SockAddr sa = SockAddr::from_string("192.168.0.1:8080");
    fmt::print("IPv4? {}\n", sa.type() == SockAddr::Type::IPv4);

    IpAddress ip;
    uint16_t port = 0;
    sa.get(ip, port);
    fmt::print("ipaddress: {}\n", ip.to_string());
    fmt::print("port: {}\n", port);
}
